Skip to main content

How to modify minimal camera rendering by script using Java

How to modify minimal Camera rendering by script using Java


In your Java class, do the following:

public class YourClass extends Component {

// value to control the minimal rendering distance of the Camera
public float minimalDistance = 0.1f; // select in properties

// creates a new SUIButton
public SUIButton button; // select in properties

// creates a new Camera
public Camera camera; // select in properties

@Override
public void start() {

}

@Override
public void repeat() {

// checking if the button was pressed
if (button.isDown()) {

// changing the minimal rendering distance of the Camera if the conditional is true
camera.setMinimalDistance(minimalDistance);
}
}
}